/*
 *  $Id: Abstract.cs 1046 2010-05-18 12:17:04Z thenn.erannor $
 *  This file is a part of Ragima CCG.
 *  (C) 2008 Ragima development group.
 *
 *  Licensed under the terms of the GNU GPL License version 2.
 *
 */

using Ragima.Languages;

namespace Ragima {
    /// <summary>
    /// Базовый класс для рас
    /// </summary>
    public abstract class Race: INamed {
        private Names _name;

        public Race(string id) {
            _name = new Names("race."+id, true);
        }
        public Race(Names name) {
            _name = name;
        }

        /// <value>
        /// Название расы
        /// </value>
        public Names Name { get { return _name; } }

        /// <summary>
        /// Проверить, является ли данная раса идентичной указанной в параметре.
        /// </summary>
        /// <param name="race">Искомая раса</param>
        /// <returns>true, если является</returns>
        public virtual bool IsRace(Race race) {
            return race == this;
        }

        public bool IsRace<T>() where T: Race, new() {
            return IsRace(RaceManager.GetRace<T>());
        }

        public virtual void SetNaturalAffects(CreatureCard card, ICollector<Affect> affects) {
        }
        public virtual void SetAbilities(CreatureCard card, ICollector<AbilityCard> abilities) {
        }
    }
}
